//
//  MPHomeCell.swift
//  MPSinaWeibo
//
//  Created by DaVinci on 16/4/13.
//  Copyright © 2016年 DaVinci. All rights reserved.
//

import UIKit
import SnapKit

class MPStatusCell: UITableViewCell {
    
    
    var statusViewModel: MPStatusViewModel? {
    
        didSet{
        
           orginView.statusViewModel = statusViewModel
        
        }
    
    }

    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        
        super.init(style: .Default, reuseIdentifier: reuseIdentifier)
        
        setupUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    var status: MPStatus? {
    
        didSet{
        
            orginView.status = status
        
        }
      
    }
    
    private func setupUI(){
    
       backgroundColor = randomColor()
       
        contentView.addSubview(orginView)
        
        //设置原创微博的约束
        orginView.snp_makeConstraints { (make) -> Void in
            
            make.left.top.right.equalTo(contentView)
            make.height.equalTo(100)
        }
    }
    
    
    //懒加载原创微博
    private lazy var orginView: MPStatusOrginView = MPStatusOrginView()
}
